﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Configuration;

namespace WordCounter
{
    public partial class MainForm : Form
    {
        private char[] delimaters;

        public MainForm()
        {
            InitializeComponent();

            delimaters = new char[] { ',', '.', ':', ';', ' ', '\n', '\r' };
            toolStripStatusLabel.Text = String.Empty;
        }

        private void Form1_TextChanged(object sender, EventArgs e)
        {
            string[] result = TextProcessor.ExplodeText(textBox1.Text, delimaters);
            toolStripStatusLabel.Text = String.Format("Words Count: {0}", result.Length);
        }
    }
}
